<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改简历')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-resume-edit" th:object="${resume}">
            <input id="resumeId" th:field="*{resumeId}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">姓名：</label>
                <div class="col-sm-8">
                    <input name="resumeName" th:field="*{resumeName}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">性别：</label>
                <div class="col-sm-8">
                    <div class="col-sm-8">
                        <select name="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{resumeSex}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">家庭住址：</label>
                <div class="col-sm-8">
                    <input name="resumeAddress" th:field="*{resumeAddress}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">毕业学校：</label>
                <div class="col-sm-8">
                    <input name="resumeSchool" th:field="*{resumeSchool}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">学历：</label>
                <div class="col-sm-8">
                    <select id="degree" name="degree" class="form-control m-b" th:with="type=${@dict.getType('degree')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{resumeDegree}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">联系方式：</label>
                <div class="col-sm-8">
                    <input name="resumePhone" th:field="*{resumePhone}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">邮箱：</label>
                <div class="col-sm-8">
                    <input name="resumeEmail" th:field="*{resumeEmail}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">个人优势：</label>
                <div class="col-sm-8">
                    <input name="resumeAdvantage" th:field="*{resumeAdvantage}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">求职意向：</label>
                <div class="col-sm-8">
                    <input name="resumeIntent" th:field="*{resumeIntent}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">工作经验：</label>
                <div class="col-sm-8">
                    <input name="workExperience" th:field="*{workExperience}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">教育经历：</label>
                <div class="col-sm-8">
                    <input name="educationExperience" th:field="*{educationExperience}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">项目经验：</label>
                <div class="col-sm-8">
                    <input name="projectExperience" th:field="*{projectExperience}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">技能特长：</label>
                <div class="col-sm-8">
                    <input name="skillSpecialty" th:field="*{skillSpecialty}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="remark" th:field="*{remark}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/resume";
        $("#form-resume-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                var data = $("#form-user-add").serializeArray();
                var resumeId = $("#resumeId").val();
                var resumeName = $("#resumeName").val();
                var resumeSex = $('#resumeSex option:selected').val();
                var resumeAddress = $("#resumeAddress").val();
                var resumeSchool = $("#resumeSchool").val();
                var degree = $('#degree option:selected').val();
                var resumePhone = $("#resumePhone").val();
                var resumeEmail = $("#resumeEmail").val();
                var resumeIntent = $("#resumeIntent").val();
                var resumeAdvantage = $("#resumeAdvantage").val();
                var workExperience = $("#workExperience").val();
                var educationExperience = $("#educationExperience").val();
                var projectExperience = $("#projectExperience").val();
                var skillSpecialty = $("#skillSpecialty").val();
                data.push({"name": "resumeId", "value": resumeId});
                data.push({"name": "resumeName", "value": resumeName});
                data.push({"name": "resumeSex", "value": resumeSex});
                data.push({"name": "resumeAddress", "value": resumeAddress});
                data.push({"name": "resumeSchool", "value": resumeSchool});
                data.push({"name": "resumeDegree", "value": degree});
                data.push({"name": "resumePhone", "value": resumePhone});
                data.push({"name": "resumeEmail", "value": resumeEmail});
                data.push({"name": "resumeAdvantage", "value": resumeAdvantage});
                data.push({"name": "resumeIntent", "value": resumeIntent});
                data.push({"name": "workExperience", "value": workExperience});
                data.push({"name": "educationExperience", "value": educationExperience});
                data.push({"name": "projectExperience", "value": projectExperience});
                data.push({"name": "skillSpecialty", "value": skillSpecialty});
                $.operate.save(prefix + "/edit", data);
            }
        }
    </script>
</body>
</html>
